
import { getCache, setCache, removeCache } from './cache'

// 站点信息
export const WEBSITENAME = 'WEBSITENAME'
export const LOGO = 'LOGO'
export const COPYRIGHT = 'COPYRIGHT'
export const INTERNETCONTENTPROVIDER = 'INTERNETCONTENTPROVIDER'
export const STARTONLINE = 'STARTONLINE'
export const ISOPENMSG = 'ISOPENMSG'

// 获取token缓存
export const getLogo = () => getCache(LOGO)
export const getWebSiteName = () => getCache(WEBSITENAME)
export const getCopyRight = () => getCache(COPYRIGHT)
export const getInternetContentProvider = () => getCache(INTERNETCONTENTPROVIDER)
export const getStartOnline = () => getCache(STARTONLINE)
export const getIsOpenMsg = () => getCache(ISOPENMSG)

// 设置token缓存
// 删除token缓存
export const saveWebSite = (data) => {
    setCache(LOGO, data.logo)
    setCache(WEBSITENAME,  data.name)
    setCache(COPYRIGHT,  data.copyright)
    setCache(INTERNETCONTENTPROVIDER,  data.internetContentProvider)
    setCache(STARTONLINE, data.startOnline)
    setCache(ISOPENMSG, data. isOpenMsg)
}

// 删除token缓存
export const removeWebSite = () => {
    removeCache(LOGO)
    removeCache(WEBSITENAME)
    removeCache(COPYRIGHT)
    removeCache(INTERNETCONTENTPROVIDER)
    removeCache(STARTONLINE)
    removeCache(ISOPENMSG)
}